﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Kristall.Engine
{
    public class Light : AABB
    {
        public Color Color { get; set; }
        public string Texture { get; set; }

        Level _level;
        
        public Light() : base()
        {
            Color = Color.White;
            this.SetSize(400, 400);
            Texture = "Radial";
        }

        public override void LoadContent(Level level)
        {
            _level = level;
        }

        public override void RemoveFromLevel()
        {
            _level.Lights.Remove(this);
        }

        public override void AddToLevel()
        {
            if (this.Id.Equals("Id_not_set"))
                this.Id = "Light" + _level.Lights.Count;

            _level.Lights.Add(this);
        }

        public void Draw(SpriteBatch batch, Texture2D texture)
        {
            batch.Draw(texture, Bounds, Color);
        }
    }
}
